
testability = I../../eth-core-infrastructure/control-channel/inc

AbstractionAPI = I../../eth-core-infrastructure/network-stack-abstraction/pub

all: object_files
	$(CXX) -shared -o libICMPModule.so bin/*.o
#	cp ./pub/* ../../frontend-com-module/com-module/LinuxComModule/inc/TC8-ICMP
	mkdir -p lib
	mv libICMPModule.so ./lib

object_files:
	$(CXX) -std=c++11 -c -fPIC src/*.c -$(AbstractionAPI) -lAbstractionAPI -Iinc -Ipub 
	mkdir -p bin
	mv *.o bin/

install: ./lib/libICMPModule.so
	sudo cp ./lib/libICMPModule.so /usr/lib1

uninstall:
	sudo rm -rf /usr/lib1/libICMPModule.so

tests: object_files
	
	$(CXX)  -$(AbstractionAPI) -$(testability) -std=c++11  -L/usr/lib1 test/TEST_ICMP_ERROR.c bin/*.o -I./pub -I./inc -lTestabilityProtocol -fpermissive -o TEST_ICMP_ERROR -lAbstractionAPI
	$(CXX)  -$(AbstractionAPI) -$(testability) -std=c++11  -L/usr/lib1 test/TEST_ICMP_TYPE.c bin/*.o -I./pub -I./inc  -lTestabilityProtocol -fpermissive -o TEST_ICMP_TYPE -lAbstractionAPI

clean:
	rm -rf bin lib *.o *.so
	rm -rf TEST_ICMP_ERROR
	rm -rf TEST_ICMP_TYPE
